/**
 * @author Liu Awen Email:willowawen@gmail.com
 * @create 2020-05-16
 */
public class Cylinder {
    //数据类型 属性名;
    private double radius;
    private double height;

    public void squaring(){
        double area = Math.PI * radius * radius * 2 + 2 * Math.PI * radius * height;
        System.out.println("圆柱体表面积为："+ area);
    }
    public  void cube(){
        double volume = Math.PI * radius * radius *height;
        System.out.println("圆柱体的体积为：" + volume);
    }


    public static void main(String[] args) {
        Cylinder  c = new Cylinder();
        c.radius = 20 ;
        c.height = 20 ;
        c.squaring() ; // 计算圆柱体表面积并在控制台输出面积
        c.cube() ; // 计算圆柱体体积并在控制台输出体积
    }

}
